/*
 * @Description:项目管理
 * @Author: ldx
 * @Date: 2022-04-06 19:34:55
 * @LastEditors: ldx
 * @LastEditTime: 2022-04-27 15:08:58
 */

import { Checkbox, Divider, Input } from 'antd'
import { useRecoilState } from 'recoil'

import { PageContainer } from '@/components'
import { commonState, UserInfo } from '@/recoil'
const options = [
  {
    label: '首页',
    value: 'home'
  },
  {
    label: '预测管理',
    value: 'predictManage'
  },
  {
    label: '报告管理',
    value: 'reportManage'
  },
  {
    label: '系统设置',
    value: 'systemSettings'
  }
]
const ProjectManage = () => {
  const [userInfo, setUserInfo] = useRecoilState<UserInfo>(commonState.userInfo)
  const [auths, setAuths] = useRecoilState(commonState.auths)
  const changeHandle = (value: any) => {
    localStorage.setItem('auth:ldx', JSON.stringify(value))
    setAuths(value)
  }
  return (
    <PageContainer subText="项目管理">
      <div className="h-100%  box-border p-20px pb-0px">
        <div className="h-100%  bg-white">
          <div>
            <Input
              value={userInfo.name}
              onChange={(event) =>
                setUserInfo({ ...userInfo, name: event.target.value })
              }
            ></Input>
            <Divider />
            <Checkbox.Group
              options={options}
              value={auths}
              onChange={changeHandle}
            />
          </div>
        </div>
      </div>
    </PageContainer>
  )
}
export default ProjectManage
